<script>
	export default {
		globalData: {
			// global_url: 'http://192.168.3.198:130',
			global_url: 'https://szr.zhim123.com',
			titleBarHeight: 0, //头部导航栏高度		
			menuButtonHeight: 0, //胶囊高度
			topBarHeight: 0, //顶部总高度
			temp_audio: {},
			temp_titles: [], //临时文案设置
			temp_coverUrl: '',
			isReload: false,
			cloneType: 0,
			ossVideoCover: '?x-oss-process=video/snapshot,t_1000,f_png,w_720,h_1280,m_fast,ar_auto', //视频封面图
			OssVideoShrink: '?x-oss-process=video/snapshot,t_1000,f_png,w_142,h_252,m_fast,ar_auto', //视频缩略图
			screenWidth: 375,
			screenHeight: 812,
			rpxToPxRatio: 2,
			// shareTitle: '我刚刚在帧流数智人看到很多的数字分身案例，分享给你~',
			// appid: 'wx3ff54e44385c4d7c',



			// 影子工厂
			// oemName: '影子工厂',
			// appid: 'wxe4a607062bb18495',
			// isShowVideo: false,
			// bannerUrl: 'banner_yzgc_oem',
			// btn1: 'btn1_yzgc_oem',
			// btn2: 'btn2_yzgc_oem',
			// btn3: 'btn3_yzgc_oem',
			// btn4: 'btn4_yzgc_oem',
			// shareTitle: '我刚刚在影子工厂看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: true,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'yingzipeople',
			// jiaochengUrl2: 'yingziVoice',
			// jiaochengUrl3: 'yingzivideo',
			// isShowurl: true,
			// url: 'http://aiyinzi.zhim123.com'


			// 云生数智
			// oemName: '云生数智',
			// appid: 'wx00ff004219aa6015',
			// isShowVideo: false,
			// bannerUrl: 'banner_yzgc_oem',
			// btn1: 'btn1_yzgc_oem',
			// btn2: 'btn2_yzgc_oem',
			// btn3: 'btn3_yzgc_oem',
			// btn4: 'btn4_yzgc_oem',
			// shareTitle: '我刚刚在云生数智看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'yingzipeople',
			// jiaochengUrl2: 'yingziVoice',
			// jiaochengUrl3: 'yingzivideo',
			// isShowurl: false,
			// url: '',



			// 星原魔方
			// oemName: '星原魔方',
			// appid: 'wx28e0931de58de3b8',
			// isShowVideo: true,
			// bannerUrl: 'banner_xyhk_oem',
			// btn1: 'btn1_xyhk_oem',
			// btn2: 'btn2_xyhk_oem',
			// btn3: 'btn3_xyhk_oem',
			// btn4: 'btn4_xyhk_oem',
			// shareTitle: '我刚刚在星原魔方看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: false,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// isShowurl: false,
			// url: '',



			// 领企数字人
			// oemName: '领企数字人',
			// appid: 'wx4175e233f13cb4db',
			// isShowVideo: true,
			// bannerUrl: 'banner_wqfs_oem',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在领企数字人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: true,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// isShowurl: true,
			// url: 'https://shuziren.lingqikeji.com.cn',



			// 逍遥
			// oemName: '航星越Ai数字人分身',
			// appid: 'wx884d7c48806f6483',
			// isShowVideo: true,
			// bannerUrl: 'banner_wqfs_oem',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在航星越Ai数字人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// isShowurl: true,
			// url: 'https://szr.jusanwenhua.com',



			// 陈王数智人
			// oemName: '陈王数智人',
			// appid: 'wx49a9e17cdc3eb7fe',
			// isShowVideo: true,
			// bannerUrl: 'banner_wqfs_oem',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在陈王数智人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// isShowurl:false,
			// url: '',



			// 智华光源数字人
			// oemName: '智华光源数字人',
			// appid: 'wxa42a670dd3058eaf',
			// isShowVideo: true,
			// bannerUrl: 'banner_wqfs_oem',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在智华光源数字人看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// isShowurl: false,
			// url: '',



			// 创灵
			// oemName: '创灵',
			// appid: 'wxc17d10d5ec7f784d',
			// isShowVideo: true,
			// bannerUrl: 'banner_lc_oem',
			// btn1: 'btn1_szr_oem',
			// btn2: 'btn2_szr_oem',
			// btn3: 'btn3_szr_oem',
			// btn4: 'btn4_szr_oem',
			// shareTitle: '我刚刚在创灵看到很多的数字分身案例，分享给你~',
			// isShowYZLogo: false,
			// isShowLQLogo: false,
			// isShowJiaochen: true,
			// jiaochengUrl1: 'clonepeople',
			// jiaochengUrl2: 'cloneVoice',
			// jiaochengUrl3: 'createVideo',
			// isShowurl: false,
			// url: '',


			oemName: '易掌数智人',
			appid: 'wx4df3d720af68d990',
			isShowVideo: true,
			bannerUrl: 'banner_wqfs_oem',
			btn1: 'btn1_szr_oem',
			btn2: 'btn2_szr_oem',
			btn3: 'btn3_szr_oem',
			btn4: 'btn4_szr_oem',
			shareTitle: '我刚刚在易掌数智人看到很多的数字分身案例，分享给你~',
			isShowYZLogo: false,
			isShowLQLogo: false,
			isShowJiaochen: true,
			jiaochengUrl1: 'clonepeople',
			jiaochengUrl2: 'cloneVoice',
			jiaochengUrl3: 'createVideo',
			isShowurl: true,
			url: 'https://ai.aiezyzwl.com',

		},
		onLaunch: async function() {
			this.globalData.titleBarHeight = uni.getMenuButtonBoundingClientRect().top
			this.globalData.menuButtonHeight = uni.getMenuButtonBoundingClientRect().height
			this.globalData.topBarHeight = (uni.getMenuButtonBoundingClientRect().top + uni
				.getMenuButtonBoundingClientRect().height)
			this.globalData.screenWidth = uni.getSystemInfoSync().screenWidth;
			this.globalData.screenHeight = uni.getSystemInfoSync().screenHeight;
			this.globalData.rpxToPxRatio = this.globalData.screenWidth / 750;

			//小程序更新
			// #ifdef MP
			const updateManager = uni.getUpdateManager();
			updateManager.onCheckForUpdate(function(res) {
				// 请求完新版本信息的回调
				// console.log(res.hasUpdate);
			});
			updateManager.onUpdateReady(function(res) {
				uni.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					showCancel: false,
					confirmText: '好的',
					success(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate();
						}
					}
				});
			});
			var isNeedLogin = true;
			var tokenInfo = uni.getStorageSync('tokenInfo');
			if (tokenInfo) {
				try {
					var checkLoginRes = await this.api.account.checklogin({});
					if (checkLoginRes.code === 0) {
						isNeedLogin = false;
					} else {
						// this.$util.msg(wxLoginRes.msg);
					}
				} catch (e) {}
			}

			if (isNeedLogin) {

				try {
					// #ifdef MP-WEIXIN
					var loginRes = await this.$mp_mini.login('weixin');
					console.log(loginRes);
					var wxLoginRes = await this.api.account.wxsmalllogin({
						appId: this.globalData.appid,
						code: loginRes.code,
					});
					if (wxLoginRes.code === 0) {
						uni.setStorageSync('tokenInfo', wxLoginRes.data);
					} else {
						this.$util.msg(wxLoginRes.msg);
					}
					// #endif
					// #ifndef MP-WEIXIN

					// #endif

				} catch (e) {
					this.$util.msg(e.message);
				}
			}
			// #endif
			this.$isResolve();
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>
<style lang="scss">
	/*每个页面公共css */
	/* 公共样式 */
	@import "css/zl_common.scss";
	/* 帧流主题样式 */
	@import "css/zl_theme.scss";

	::-webkit-scrollbar {
		width: 0 !important;
		height: 0 !important;
		background-color: transparent;
	}
</style>